<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Faiss: faiss::gpu::BlockSelect&lt; K, V, Dir, Comp, NumWarpQ, NumThreadQ, ThreadsPerBlock &gt; Struct Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Faiss
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacefaiss.html">faiss</a></li><li class="navelem"><b>gpu</b></li><li class="navelem"><a class="el" href="structfaiss_1_1gpu_1_1BlockSelect.html">BlockSelect</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="structfaiss_1_1gpu_1_1BlockSelect-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">faiss::gpu::BlockSelect&lt; K, V, Dir, Comp, NumWarpQ, NumThreadQ, ThreadsPerBlock &gt; Struct Template Reference</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a8060f5ed8c500dd685eac6e74461c0ec"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8060f5ed8c500dd685eac6e74461c0ec"></a>
__device__&#160;</td><td class="memItemRight" valign="bottom"><b>BlockSelect</b> (K initKVal, V initVVal, K *smemK, V *smemV, int k)</td></tr>
<tr class="separator:a8060f5ed8c500dd685eac6e74461c0ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af9bba03961f824cec6dbd7505a90b7e5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af9bba03961f824cec6dbd7505a90b7e5"></a>
__device__ void&#160;</td><td class="memItemRight" valign="bottom"><b>addThreadQ</b> (K k, V v)</td></tr>
<tr class="separator:af9bba03961f824cec6dbd7505a90b7e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a64b3236119d10096e807f489d41db83e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a64b3236119d10096e807f489d41db83e"></a>
__device__ void&#160;</td><td class="memItemRight" valign="bottom"><b>checkThreadQ</b> ()</td></tr>
<tr class="separator:a64b3236119d10096e807f489d41db83e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a08aa08d16ec29c7b7dccc65edd5115cd"><td class="memItemLeft" align="right" valign="top">__device__ void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1gpu_1_1BlockSelect.html#a08aa08d16ec29c7b7dccc65edd5115cd">mergeWarpQ</a> ()</td></tr>
<tr class="separator:a08aa08d16ec29c7b7dccc65edd5115cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a52e2521dfc565075e73ff1a4c53474d9"><td class="memItemLeft" align="right" valign="top">__device__ void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1gpu_1_1BlockSelect.html#a52e2521dfc565075e73ff1a4c53474d9">add</a> (K k, V v)</td></tr>
<tr class="separator:a52e2521dfc565075e73ff1a4c53474d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0c66de4a8be3e2d06b67e3e43578f431"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0c66de4a8be3e2d06b67e3e43578f431"></a>
__device__ void&#160;</td><td class="memItemRight" valign="bottom"><b>reduce</b> ()</td></tr>
<tr class="separator:a0c66de4a8be3e2d06b67e3e43578f431"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a7c8a274e1f130d1d2ba6d37548a451c5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7c8a274e1f130d1d2ba6d37548a451c5"></a>
const K&#160;</td><td class="memItemRight" valign="bottom"><b>initK</b></td></tr>
<tr class="separator:a7c8a274e1f130d1d2ba6d37548a451c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaeb875cb450c12de1c400a4d9ab2c810"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaeb875cb450c12de1c400a4d9ab2c810"></a>
const V&#160;</td><td class="memItemRight" valign="bottom"><b>initV</b></td></tr>
<tr class="separator:aaeb875cb450c12de1c400a4d9ab2c810"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8dfd6f1d2aa47c6110314227ed859537"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8dfd6f1d2aa47c6110314227ed859537"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>numVals</b></td></tr>
<tr class="separator:a8dfd6f1d2aa47c6110314227ed859537"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afa35e0874473b7c5328b471789f31251"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afa35e0874473b7c5328b471789f31251"></a>
K&#160;</td><td class="memItemRight" valign="bottom"><b>warpKTop</b></td></tr>
<tr class="separator:afa35e0874473b7c5328b471789f31251"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9bd7c52579e1cd50b0c97fb7b16b897c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9bd7c52579e1cd50b0c97fb7b16b897c"></a>
K&#160;</td><td class="memItemRight" valign="bottom"><b>threadK</b> [NumThreadQ]</td></tr>
<tr class="separator:a9bd7c52579e1cd50b0c97fb7b16b897c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6271b883be75295195f5aed618c5f6de"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6271b883be75295195f5aed618c5f6de"></a>
V&#160;</td><td class="memItemRight" valign="bottom"><b>threadV</b> [NumThreadQ]</td></tr>
<tr class="separator:a6271b883be75295195f5aed618c5f6de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af57c3f4f2b1fe43bceac10cd5725e2bd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af57c3f4f2b1fe43bceac10cd5725e2bd"></a>
K *&#160;</td><td class="memItemRight" valign="bottom"><b>sharedK</b></td></tr>
<tr class="separator:af57c3f4f2b1fe43bceac10cd5725e2bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a534d3bac7d36bb224c2deeb63cbf434e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a534d3bac7d36bb224c2deeb63cbf434e"></a>
V *&#160;</td><td class="memItemRight" valign="bottom"><b>sharedV</b></td></tr>
<tr class="separator:a534d3bac7d36bb224c2deeb63cbf434e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad2ea5396b3610c4a77f0f4e78bee39dc"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad2ea5396b3610c4a77f0f4e78bee39dc"></a>
K *&#160;</td><td class="memItemRight" valign="bottom"><b>warpK</b></td></tr>
<tr class="separator:ad2ea5396b3610c4a77f0f4e78bee39dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a33b261f51f3fc052c2c0c79eb221df29"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a33b261f51f3fc052c2c0c79eb221df29"></a>
V *&#160;</td><td class="memItemRight" valign="bottom"><b>warpV</b></td></tr>
<tr class="separator:a33b261f51f3fc052c2c0c79eb221df29"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7045c270802405a8cfbd65f6dba096f4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7045c270802405a8cfbd65f6dba096f4"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>kMinus1</b></td></tr>
<tr class="separator:a7045c270802405a8cfbd65f6dba096f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:a4f7571d5e725cdefb3691ce61f424af2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4f7571d5e725cdefb3691ce61f424af2"></a>
static constexpr int&#160;</td><td class="memItemRight" valign="bottom"><b>kNumWarps</b> = ThreadsPerBlock / kWarpSize</td></tr>
<tr class="separator:a4f7571d5e725cdefb3691ce61f424af2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a02f8627239a279fc925b3661d45dcdd6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a02f8627239a279fc925b3661d45dcdd6"></a>
static constexpr int&#160;</td><td class="memItemRight" valign="bottom"><b>kTotalWarpSortSize</b> = NumWarpQ</td></tr>
<tr class="separator:a02f8627239a279fc925b3661d45dcdd6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename K, typename V, bool Dir, typename Comp, int NumWarpQ, int NumThreadQ, int ThreadsPerBlock&gt;<br/>
struct faiss::gpu::BlockSelect&lt; K, V, Dir, Comp, NumWarpQ, NumThreadQ, ThreadsPerBlock &gt;</h3>


<p>Definition at line <a class="el" href="Select_8cuh_source.html#l00082">82</a> of file <a class="el" href="Select_8cuh_source.html">Select.cuh</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a52e2521dfc565075e73ff1a4c53474d9"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K , typename V , bool Dir, typename Comp , int NumWarpQ, int NumThreadQ, int ThreadsPerBlock&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">__device__ void <a class="el" href="structfaiss_1_1gpu_1_1BlockSelect.html">faiss::gpu::BlockSelect</a>&lt; K, V, Dir, Comp, NumWarpQ, NumThreadQ, ThreadsPerBlock &gt;::add </td>
          <td>(</td>
          <td class="paramtype">K&#160;</td>
          <td class="paramname"><em>k</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">V&#160;</td>
          <td class="paramname"><em>v</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>WARNING: all threads in a warp must participate in this. Otherwise, you must call the constituent parts separately. </p>

<p>Definition at line <a class="el" href="Select_8cuh_source.html#l00213">213</a> of file <a class="el" href="Select_8cuh_source.html">Select.cuh</a>.</p>

</div>
</div>
<a class="anchor" id="a08aa08d16ec29c7b7dccc65edd5115cd"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K , typename V , bool Dir, typename Comp , int NumWarpQ, int NumThreadQ, int ThreadsPerBlock&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">__device__ void <a class="el" href="structfaiss_1_1gpu_1_1BlockSelect.html">faiss::gpu::BlockSelect</a>&lt; K, V, Dir, Comp, NumWarpQ, NumThreadQ, ThreadsPerBlock &gt;::mergeWarpQ </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>This function handles sorting and merging together the per-thread queues with the warp-wide queue, creating a sorted list across both </p>

<p>Definition at line <a class="el" href="Select_8cuh_source.html#l00176">176</a> of file <a class="el" href="Select_8cuh_source.html">Select.cuh</a>.</p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>/data/users/hoss/faiss/gpu/utils/<a class="el" href="Select_8cuh_source.html">Select.cuh</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
